package com.whuan.lambda;

import java.util.function.Function;
import java.util.function.Predicate;

public class lambda6 {

    public static void main(String[] args) {
//        Predicate<String> i  = (s)-> s.length() > 5;
//
//        System.out.println(i.test("www.w3cschool.cn "));

        Function<Integer, String> func1  = x -> Integer.toBinaryString(x);
        System.out.println(func1.apply(10));

        // Using  a  method  reference
        Function<Integer, String> func2  = Integer::toBinaryString;
        System.out.println(func2.apply(10));
    }
}
